<?php
/**
 * 竞标项目验证器
 */

namespace app\common\validate;

class ProjectValidate extends CommonBaseValidate
{
    protected $rule = [
            'title|标题' => 'require',
    'cate_id|分类' => 'require',
    'content|内容' => 'require',
    'detail|采购清单' => 'require',
    'start_time|开始时间' => 'require',
    'sort|排序' => 'require|number',
    'status|状态' => 'require',

    ];

    protected $message = [
            'title.required' => '标题不能为空',
    'cate_id.required' => '分类不能为空',
    'content.required' => '内容不能为空',
    'detail.required' => '采购清单不能为空',
    'start_time.required' => '开始时间不能为空',
    'sort.required' => '排序不能为空',
    'sort.number' => '排序必须为纯数字',
    'status.required' => '状态不能为空',

    ];

    protected $scene = [
        'admin_add'     => ['title', 'cate_id', 'content', 'detail', 'start_time', 'sort', 'status', ],
        'admin_edit'    => ['id', 'title', 'cate_id', 'content', 'detail', 'start_time', 'sort', 'status', ],
        'admin_del'     => ['id', ],
        'admin_disable' => ['id', ],
        'admin_enable'  => ['id', ],
        'api_add'       => ['title', 'cate_id', 'content', 'detail', 'start_time', 'sort', 'status', ],
        'api_info'      => ['id', ],
        'api_edit'      => ['id', 'title', 'cate_id', 'content', 'detail', 'start_time', 'sort', 'status', ],
        'api_del'       => ['id', ],
        'api_disable'   => ['id', ],
        'api_enable'    => ['id', ],
    ];
}
